package framework.mvc;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public abstract class ACustomButton implements ActionListener {

    private JButton button;
    protected AFincoView view;
    protected String actionName;

    public ACustomButton(AFincoView view, String actionName) {
        this.view = view;
        this.actionName = actionName;
        int butHeight = 35;
        int butWidth = 190;
        button = new JButton(actionName);
        button.setSize(butWidth, butHeight);
        button.addActionListener(this);
    }

    public JButton getButton() {
        return button;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        fireClick();
    }

    public abstract void fireClick();
}
